/**
 * 
 */
package com.zhaokuo.dao;

import java.io.Serializable;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;

import com.zhaokuo.config.AbstractDao;
import com.zhaokuo.model.Model;

/**
 * @author zk 2012-3-19
 *
 */
public abstract class MasterAbstractDao<T extends Model,PK extends Serializable> extends AbstractDao<T, PK> implements MasterDao<T, PK>{


	private SqlSession masterSqlSession;
	
	private SqlSessionFactory masterSqlSessionFactory;
	
	@Resource(name="masterSqlSession")
	public void setMasterSqlSessionTemplate(SqlSessionTemplate masterSqlSessionTemplate) {
	    this.masterSqlSession = masterSqlSessionTemplate;
	}

	@Resource(name="masterSqlSessionFactory")
	public void setMasterSqlSessionFactory(SqlSessionFactory masterSqlSessionFactory) {
		this.masterSqlSessionFactory = masterSqlSessionFactory;
	}
	
	@Override
	protected SqlSession callMasterSqlsession() {
		return masterSqlSession;
	}
	
	@Override
	protected SqlSessionFactory callMasterSqlsessionFactory() {
		return masterSqlSessionFactory;
	}
}
